package 力扣日常刷题.木22二月.第13天219;

/**
 * @author 帅小伙
 * @date 2022/2/19
 * @description
 * 开始错后面都会错
 */
public class Demo100第一个错误的版本 {

    public int firstBadVersion(int n) {
        int l = 1, r = n;

        while (l < r) {
            int mid = (l + r) / 2;
            if (isBadVersion(mid))
                r = mid;
            else
                l = mid + 1;
        }
        return l;
    }

    boolean isBadVersion(int version) {
        return true;
    }

}
